* Load data
use "$data/main_touse.dta", clear
svyset RespondiID [pweight=weights_full_sample]

* Regression test and adjustment approach
regress patience_ctb_trim i.ctb
outreg2 using "$output/TableA1.xls", ctitle("Noweigts" "Linear Regression") excel bdec(3) sdec(3) stats(coef se) replace

svy: regress patience_ctb_trim i.ctb
outreg2 using "$output/TableA1.xls", ctitle("Weights" "Linear Regression") excel bdec(3) sdec(3) stats(coef se) append

regress patience_ctb_trim i.ctb age3549 age5064 age65above ///
hs some_college ba_or_more ///
i.inc_group ///
female white
outreg2 using "$output/TableA1.xls", ctitle("Patience by Payoff Mechanism" "Linear Regression") excel bdec(3) sdec(3) stats(coef se) append

svy: regress patience_ctb_trim i.ctb age3549 age5064 age65above ///
hs some_college ba_or_more ///
i.inc_group ///
female white
outreg2 using "$output/TableA1.xls", ctitle("Patience by Payoff Mechanism" "Linear Regression") excel bdec(3) sdec(3) stats(coef se) append

qreg patience_ctb_trim i.ctb 
outreg2 using "$output/TableA1.xls", ctitle("Patience by Payoff Mechanism" "Quantile Regression") excel bdec(3) sdec(3) stats(coef se) append

qreg patience_ctb_trim i.ctb age3549 age5064 age65above ///
hs some_college ba_or_more ///
i.inc_group ///
female white
outreg2 using "$output/TableA1.xls", ctitle("Patience by Payoff Mechanism" "Quantile Regression") excel bdec(3) sdec(3) stats(coef se) append
